#! /bin/bash

set -e
set -x
cd /home/jenkins

export PATH=${JAVA_HOME}/bin:${PATH}
export HOME=/home/jenkins
env

# Clone h2o-3
git clone https://github.com/h2oai/h2o-3
cd h2o-3
git checkout ${H2O_BRANCH}
# Warm-up gradle caches for h2o-ext-xgboost:testJar task
./gradlew clean && ./gradlew h2o-ext-xgboost:testJar

cd /home/jenkins

# Removed h2o-3
rm -rf /home/jenkins/h2o-3